Skip to content

A routine's Run now is not held back by the sweep's cooldown (#1642) - #1645

Merged
suleimansh merged 2 commits into
mainfrom
suleimansh/fix/1642-click-skips-cooldown
Aug 22, 2026
Merged

A routine's Run now is not held back by the sweep's cooldown (#1642)#1645
suleimansh merged 2 commits into
mainfrom
suleimansh/fix/1642-click-skips-cooldown

Conversation

@suleimansh

Copy link
Copy Markdown
Contributor

🤖 automated

Fixes #1642 — option A.

What changed. autoPmDecision takes onDemand, and skips the 30-minute cooldown when it is set. The sweep passes the flag through from tick({ onDemand }). One condition, one flag, no new state.

Why A. The cooldown paces work nobody asked for. A click is someone asking — the same reading that already lets an on-demand sweep outrank the master switch (auto-pm.ts tick doc, #1210). Before this, a Run now fired within half an hour of any run on that project stood down with "a run was started for this project a moment ago" — reported in small grey text under the fold of the card, after the click, while the button stayed enabled and its tooltip still promised agents. The only way past it was restarting the daemon.

What is deliberately not waived: the concurrency cap. The #685 double-tick test names the cooldown as what stops a tick that lands before the spawn registers from doubling up. For a click that guard is the cap alone, and it holds: start() resolves after the spawn, ticks are serialized by sweeping, so a second click counts the first agent. The new decision test pins both halves — through the cooldown when asked, still refused at the cap.

Spec. auto-pm.SPEC.md said "Run now skips only the master switch". It now says it skips the master switch and the cooldown, and why the cap stays.

Verified. auto-pm.test: 91/91. With the bypass removed from the gate, exactly the two #1642 tests fail and nothing else; restored, green. tsc --noEmit clean.

Independent of #1640 (different lines of auto-pm.ts; branched from main).

suleimansh and others added 2 commits August 23, 2026 00:35
After any run on a project, the sweep's 30-minute cooldown stood every
later pass down with "a run was started for this project a moment ago".
Since #1210 a Run now is a sweep, so for half an hour the button could
start nothing — the stand-down is reported in small text under the fold of
the card, after the click, while the button stays enabled and its tooltip
still promises agents. Restarting the daemon cleared it, which is how the
#1640 dogfood got past it.

The cooldown paces work nobody asked for. A click is someone asking, the
same reading that already lets an on-demand sweep outrank the master
switch. So `autoPmDecision` takes `onDemand` and skips the cooldown for
it; the sweep passes the flag through.

The concurrency cap is deliberately not waived with it. The #685 test
names the cooldown as what stops a tick landing before the spawn registers
from doubling up; for a click that guard is the cap alone, which holds
because `start()` resolves after the spawn and ticks are serialized, so a
second click counts the first. The new decision test pins both halves.

`auto-pm.SPEC.md` said Run now skips only the master switch; it now names
the cooldown too, and why.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@suleimansh
suleimansh merged commit ab9fd8a into main Aug 22, 2026
2 checks passed
@suleimansh
suleimansh deleted the suleimansh/fix/1642-click-skips-cooldown branch August 22, 2026 21:57
@suleimansh

Copy link
Copy Markdown
Contributor Author

🤖 automated

Dogfooded on main after merge: the drain's Run now clicked 17 minutes after a sweep-started run went through — started 2 agents, claims committed first, two PRs open within two minutes and merged by CI watch — where yesterday the same click stood down with "a run was started for this project a moment ago". Full chain on #1204: #1204 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run now can be swallowed by the 30-minute cooldown, and the button looks like it did nothing

1 participant